package com.buercorp.wangyu.oop.shop;

public class ShopText {
    public static void main(String[] args) {
        // 创建一个数组
        Shop [] arr = new Shop[3];

        // 创建三个商品对象
        Shop g1 = new Shop("001","小米",7999.0,200);
        Shop g2 = new Shop("002","华为",2999.0,200);
        Shop g3 = new Shop("003","OPPO",5999.0,200);

        // 把商品添加到数组中
        arr[0] = g1;
        arr[1] = g2;
        arr[2] = g3;

        // 循环遍历
        for (int i = 0; i < arr.length; i++) {
                Shop shop = arr[i];
            System.out.println(shop.getId() + shop.getName() + shop.getCount() + shop.getPrice());
        }
    }
}
